function getBusinessPartnerById(id)
{
	try
	{
		var businesspartner = $.jStorage.get(id);
	}
	catch
	{
		return "Error 1048: No Business Partner Found locally, try going online and check again";
	}	
	
	return businesspartner;
}

function setBusinessPartnerById(id,struc_json)
{
	//Before setting the value check the following
	/*
		* if storage is available, set the value else throw an error
		* Check if the key already exists
		* Set the item
		
	*/

	If(checkIfIdExists(id))
	{
		try
		{
			$.storage.deleteKey(id);
			$.jStorage.set(id,struc_json);
		}
		catch{
			return "Error 1049: Could not store the Business Partner, please try again"; 	
		}
	}
	else
	{
		try{
			$.jStorage.set(id,struc_json);
		}
		catch
		{
			return "Error 1049a: Could not store the Business Partner, please try again"; 
		}
	}
}
function checkIfIdExists(id)
{
	var checkIf = getBusinessPartnerById(id);
	return checkIf;
}
function checkStorageSize()
{
	if($.jStorage.storageAvailable())
		return true;
	else
		return false;
}